﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for UserControl2.xaml
    /// </summary>
    public partial class TWBH03 : ViewBase
    {
        #region ==dwWBH===========
        public static readonly DependencyProperty dwWBHProperty = DependencyProperty.Register("dwWBH",
            typeof(DataRow), typeof(TWBH03),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OndwWBHChanged));
        public DataRow dwWBH
        {
            get
            {
                return (DataRow)GetValue(dwWBHProperty);
            }
            set
            {
                SetValue(dwWBHProperty, value);
            }
        }
        private static void OndwWBHChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as TWBH03;
            if (src != null)
            {
                src.dwWBH = (DataRow)e.NewValue;
            }
        }
        #endregion
        public TWBH03()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VWBFEHL();
            IsMasterFromMV = true;
            TBMain = MV.SetProd.Tables[TB];
            InitializeComponent();
        }
        public override void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            base.Window_Loaded(sender, e);
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e); 
        }
    }
}
